import axios from './api' // 倒入 api
import config from './config.js' // 倒入默认配置
export const BASEURL = config.baseURL

/* 将所有接口统一起来便于维护
 * 如果项目很大可以将 url 独立成文件，接口分成不同的模块
 */

export const IMAGEPATH = BASEURL + 'appserver'

// 成交-成交记录-列表
export const GETDEALSEARCH = (params) => {
  return axios({
    url: 'deal/search',
    method: 'GET',
    params,
  })
}

// 成交-成交记录-查询用户成交信息
export const GETORDEROPTIONS = (params) => {
  return axios({
    url: 'order/options',
    method: 'GET',
    params,
  })
}

// 成交-成交记录-收款变动
export const DEALINFOCHANGE = (params) => {
  return axios({
    url: 'deal/change',
    method: 'POST',
    data:params,
  })
}

// 成交-成交记录-历史收款记录
export const GETDEALHISTORY = (params) => {
  return axios({
    url: 'deal/history',
    method: 'GET',
    params,
  })
}

// 成交-收款记录
export const GETDEALCOLLECTSEARCH = (params) => {
  return axios({
    url: 'deal/collectSearch',
    method: 'GET',
    params,
  })
}

// 成交-业绩核算
export const GETDEALBUSINESSSEARCH = (params) => {
  return axios({
    url: 'deal/businessSearch',
    method: 'GET',
    params,
  })
}


// 成交-收款记录-导出excel
export const DEALCOLLECTEXPORT = BASEURL + 'deal/collectExport'

// 成交-成交记录-导出excel
export const DEALEXPORT = BASEURL + 'deal/export'

// 成交-业绩核算-导出excel
export const DEALBUSINESSEXPORT = BASEURL + 'deal/businessExport'

// 成交-收款记录-修改收款记录
export const EDITDEALCOLLECTINFO = (params) => {
  return axios({
    url: 'deal/collect/edit',
    method: 'POST',
    data:params,
  })
}

// 成交-获取成交记录详情
export const GET_DEAL_INFO = (params) => {
  return axios({
    url: 'deal/info',
    method: 'GET',
    params,
  })
}

// 成交-成交记录-修改潜在成交
export const EDIT_POTENTIAL_INFO = (params) => {
  return axios({
    url: 'deal/potential/edit',
    method: 'POST',
    data:params,
  })
}